/**
 * Copyright (c) 2018-2028, Chill Zhuang 庄骞 (smallchill@163.com).
 * <p>
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 * <p>
 * http://www.apache.org/licenses/LICENSE-2.0
 * <p>
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package com.babble.blog.service;

import com.babble.blog.dto.QueryBlogDTO;
import com.babble.blog.entity.Blog;
import com.babble.blog.vo.BlogSaveVO;
import com.babble.blog.vo.BlogUpdVO;
import com.babble.blog.vo.BlogVO;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.service.IService;
import org.springblade.common.exception.MsgException;

import java.util.List;

/**
 * 博客文章表 服务类
 *
 * @author Blade
 * @since 2021-11-19
 */
public interface IBlogService extends IService<Blog> {

	/**
	 * 自定义分页
	 *
	 * @param page
	 * @param blog
	 * @return
	 */
	IPage<BlogVO> selectBlogPage(IPage<BlogVO> page, BlogVO blog);

	/**
	 * 添加博客
	 * @param blog
	 */
	void saveBlog(BlogSaveVO blogSaveVO) throws MsgException, MsgException, MsgException;

	/**
	 * 获取指定分类和页数的博客
	 * @param map
	 * @return
	 */
	List<BlogVO> list(QueryBlogDTO queryBlogDTO);

	/**
	 * 博客加点击量
	 * @param id
	 */
	void clickBlog(String id) throws MsgException;

	/**
	 * 根据ID获取文章合集
	 * @param id
	 * @return
	 */
	List<BlogVO> listById(String id) throws MsgException;

	/**
	 * 修改文章
	 * @param blogUpdVO
	 */
	void updBlog(BlogUpdVO blogUpdVO) throws MsgException, MsgException;

	void del(String id);
}
